package pl.kaczanowscy.tomek.ipdl.examples

import pl.kaczanowscy.tomek.ipdl.Strategy
import pl.kaczanowscy.tomek.ipdl.ClassicTwoPlayersGame
import pl.kaczanowscy.tomek.ipdl.Game
import pl.kaczanowscy.tomek.ipdl.TwoPlayersGame
import pl.kaczanowscy.tomek.ipdl.strategy.ALLD
import pl.kaczanowscy.tomek.ipdl.strategy.TFT

/**
 * An example of two players game.
 * @author tomek
 *
 */
public class TwoPlayersGameExample extends AbstractExample {
	
	private Strategy sA, sB
	
	private Game game
	
	public TwoPlayersGameExample(ExampleBuilder builder) {
		super(builder)
		builder.setTitle "Two players game"
		sA = new ALLD()
		sB = new TFT()
		game = new ClassicTwoPlayersGame(sA, sB, 20)
	}
	
	public static void main(String[] args) {
		TwoPlayersGameExample example = new TwoPlayersGameExample()
		example.show()
	}
	
	public void show() {
		builder.add("gameInfo", game.toString())
		builder.add("gameResult", game.play().toString())		
	}
}
